APN(){
#cd "${1%/*}"
apn="`dumpsys connectivity | grep 'NetworkAgentInfo{' | grep -Eiv 'extra: ims'| grep -o 'extra: [^ ]*' | grep -o '[^* ]*$' | grep -o ^[0-9,a-z]*`"
#apn="`dumpsys connectivity | grep 'NetworkAgentInfo{' | grep -Eiv 'extra: ims'| grep -o 'extra: [^ ]*' | grep -o '[^* ]*$' | sed 's/\}/ /'`"
#kgsj="`svc data disable` && `svc data enable`"

if [ 3gnet == $apn ];then 
grep 联通cns config.ini || ./联通cns.sh && $kgsj 
fi
if [ ctnet == $apn ];then
grep 电信cns config.ini || ./电信cns.sh && $kgsj
fi
if [ ctwap == $apn ];then
sleep 3 
grep 电信cx config.ini || ./电信cx.sh && $kgsj
fi
}
if [[ ! `pgrep clnc` ]]; then
Core/CuteBi start
fi
while sleep 1;do APN;done &>/dev/null &